package com.haipumi.back.actions;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.haipumi.beans.DataGrid;
import com.haipumi.beans.haipumi_helpInfo;
import com.haipumi.biz.impl.BackHelpInfoBizImpl;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;


@Controller("backHelpInfoAction")
public class BackHelpInfoAction extends ActionSupport {

	@Autowired
	BackHelpInfoBizImpl backHelpInfoBiz;
	

	DataGrid dg=new DataGrid();
	
	

	public DataGrid getDg() {
		return dg;
	}
	public String doHelp(){
		String op=null;
		HttpServletRequest request=ServletActionContext.getRequest();
		HttpServletResponse response=ServletActionContext.getResponse();
		op=request.getParameter("op");
		if("findallhelpinfo".equals(op)){
			findallhelpinfo(request,response);
		}
		return Action.SUCCESS;
	}

	private void findallhelpinfo(HttpServletRequest request,
			HttpServletResponse response) {
		List<haipumi_helpInfo>helpinfolist=null;
		helpinfolist=backHelpInfoBiz.findAllHelpInfo();
		int r=0;
		r=backHelpInfoBiz.countAllHelpeInfo();
		dg.setRows(helpinfolist);
		dg.setTotal(r);
	}
}
